home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: May 29, 1997
- // Author: ajp
- //
- // Procedure Name:
- // AErigidConstraintTemplate
- //
- // Description Name;
- // Creates the attribute editor controls for the rigidConstraint node
- //
- // Input Value:
- // nodeName
- //
- // Output Value:
- // None
- //
-
- global proc AErigidConstraintTemplate( string $nodeName )
- {
-
- editorTemplate -suppress "rigidBody1";
- editorTemplate -suppress "rigidBody2";
- editorTemplate -suppress "worldVector";
-
- editorTemplate -beginScrollLayout;
-
- AEtransformMain $nodeName;
-
- editorTemplate -beginLayout "Rigid Constraint Attributes" -collapse false;
- editorTemplate -addControl "constraintType" "constraintTypeControls";
- editorTemplate -addControl "interpenetrate";
- editorTemplate -addControl "initialPosition";
- editorTemplate -addControl "initialOrientation";
-
- editorTemplate -addSeparator;
-
- editorTemplate -addControl "force";
- editorTemplate -addControl "solverId";
- editorTemplate -endLayout;
-
- editorTemplate -beginLayout "Spring Attributes";
- editorTemplate -addControl "springStiffness";
- editorTemplate -addControl "springDamping";
- editorTemplate -addControl "springRestLength";
- editorTemplate -endLayout;
-
- editorTemplate -beginLayout "Constraint Control";
- editorTemplate -addControl "constrain";
- editorTemplate -addControl "relativeTo" "relativeToControls";
- editorTemplate -addControl "userDefinedPosition";
- editorTemplate -endLayout;
-
- editorTemplate -suppress "translate";
- editorTemplate -suppress "rotate";
- editorTemplate -suppress "scale";
- editorTemplate -suppress "shear";
- editorTemplate -suppress "rotateOrder";
- editorTemplate -suppress "rotateAxis";
- editorTemplate -suppress "rotatePivot";
- editorTemplate -suppress "rotatePivotTranslate";
- editorTemplate -suppress "scalePivot";
- editorTemplate -suppress "scalePivotTranslate";
- editorTemplate -suppress "minTransLimit";
- editorTemplate -suppress "maxTransLimit";
- editorTemplate -suppress "minRotLimit";
- editorTemplate -suppress "maxRotLimit";
- editorTemplate -suppress "minScaleLimit";
- editorTemplate -suppress "maxScaleLimit";
- editorTemplate -suppress "geometry";
- editorTemplate -suppress "selectHandle";
- editorTemplate -suppress "displayHandle";
- editorTemplate -suppress "displayRotatePivot";
- editorTemplate -suppress "displayScalePivot";
- editorTemplate -suppress "displayLocalAxis";
- editorTemplate -suppress "dynamics";
- editorTemplate -suppress "showManipDefault";
-
- // include/call base class/node attributes
- AEdynBaseTemplate $nodeName;
- AEdynObjectCommon $nodeName;
- AEdynObjectInclude $nodeName;
-
- editorTemplate -addExtraControls;
- editorTemplate -endScrollLayout;
-
- }
-
-
- global proc relativeToControls( string $nodeName )
- {
- string $attr = $nodeName + ".relativeTo";
- int $type = `getAttr $attr`;
-
- if ($type == 3)
- {
- // User Defined Position
- editorTemplate -dimControl $nodeName "userDefinedPosition" false;
- }
- else
- {
- editorTemplate -dimControl $nodeName "userDefinedPosition" true;
- }
- }
-
-
- global proc constraintTypeControls( string $nodeName )
- {
- string $attr = $nodeName + ".constraintType";
- int $type = `getAttr $attr`;
-
- if ($type == 1) {
- // Pin
- editorTemplate -dimControl $nodeName "interpenetrate" false;
- editorTemplate -dimControl $nodeName "springStiffness" true;
- editorTemplate -dimControl $nodeName "springDamping" true;
- editorTemplate -dimControl $nodeName "springRestLength" true;
- editorTemplate -dimControl $nodeName "initialPosition" false;
- editorTemplate -dimControl $nodeName "initialOrientation" true;
- } else if ($type == 2 || $type == 5) {
- // 2 = Nail & 5 = Barrier
- editorTemplate -dimControl $nodeName "interpenetrate" true;
- editorTemplate -dimControl $nodeName "springStiffness" true;
- editorTemplate -dimControl $nodeName "springDamping" true;
- editorTemplate -dimControl $nodeName "springRestLength" true;
- editorTemplate -dimControl $nodeName "initialPosition" false;
-
- if ( $type == 5 )
- {
- editorTemplate -dimControl $nodeName "initialOrientation" false;
- }
- else
- {
- editorTemplate -dimControl $nodeName "initialOrientation" true;
- }
- } else if ($type == 3 || $type == 4) {
- // 3 = uniHinge & 4 = hinge
- editorTemplate -dimControl $nodeName "interpenetrate" false;
- editorTemplate -dimControl $nodeName "springStiffness" true;
- editorTemplate -dimControl $nodeName "springDamping" true;
- editorTemplate -dimControl $nodeName "springRestLength" true;
- editorTemplate -dimControl $nodeName "initialPosition" false;
- editorTemplate -dimControl $nodeName "initialOrientation" false;
- } else if ($type == 6 || $type == 7) {
- // spring & 7 = multi spring
- editorTemplate -dimControl $nodeName "interpenetrate" false;
- editorTemplate -dimControl $nodeName "springStiffness" false;
- editorTemplate -dimControl $nodeName "springDamping" false;
- editorTemplate -dimControl $nodeName "springRestLength" false;
- editorTemplate -dimControl $nodeName "initialPosition" true;
- editorTemplate -dimControl $nodeName "initialOrientation" true;
- }
- }
-